﻿@model Provider.Models.Tool

@{
    ViewBag.Title = Model.Name;
}

<h2>@ViewBag.Title.</h2>
@Html.Raw(Model.Description)

<h4 style="border-bottom:1px solid">Sharing</h4>
<p>
    To use this tool in your consumer application, copy and paste this URL:<br />
    @Html.TextBox("Url", Url.Action("View", "Tool", new RouteValueDictionary( new {id = Model.ToolId} ), (Request == null ? "http" : Request.Url == null ? "http" : Request.Url.Scheme)), new { @readonly = "readonly", @class = "form-control" })
</p>

<h4 style="border-bottom:1px solid">Content</h4>
<div>
    @if (string.IsNullOrEmpty(Model.Content)) {
        <text>(empty)</text>
    } else {
        @Html.Raw(Model.Content)
    }
</div>

<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.ToolId }) |
    @Html.ActionLink("Back to List", "Index")
</p>